package edu.webtek.cloudresp;

import org.jdom2.Document;
import org.jdom2.Element;

public class RespItemID extends RespBase {
	final private int itemID;

	public int getItemID() {
		return itemID;
	}
	public RespItemID(Document itemid) {
		int itemID = 0;
		if(itemid == null){
			this.itemID = itemID;
			flagResponseError();
			return;
		}
		
		for(Element attr : itemid.getRootElement().getChildren()){
			switch(attr.getName()){
			case "itemID":
				itemID = Integer.parseInt(attr.getText()); 
				break;
			}
		}
		this.itemID = itemID;
	}
}
